package com.hyz.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hyz.pojo.Repository;
import com.hyz.service.RepositoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author HGD
 * @date 2022/10/3 21:16
 */
@RestController
@RequestMapping("/repository")
public class RepositoryController {
    @Autowired
    private RepositoryService service;

    @PostMapping("/getAllRepositories")
    public List<Repository> getAllRepositories() {
        return service.list();
    }

    @PostMapping("/getRepositoryById")
    public Repository getRepositoryById(@RequestBody Long repositoryId) {
        return service.getById(repositoryId);
    }
}
